<template>
  <div style>
    <Header :MenuId="MenuId"></Header>
    <div>
      <!-- <router-link to="/Scheme">test</router-link> -->
    </div>
    <div class="bodyContent">
      <div class="typeArea">
        <div class="box1 bothPadding">
          <div class="ace-floor" data-floor-name="首屏容器" style="margin-top:20px;">
            <div class="flex">
              <!-- 左边栏 -->
              <div class="index-menu" @mouseleave="leaveLeftMenu" @mouseenter="onLeftMenu">
                <div class="index-menu-wrap">
                  <span class="index-menu-title">Selection Scheme</span>
                  <div class="index-menu-list">
                    <div
                      class="index-menu-item"
                      v-for="(item, index) in leftMenuList"
                      :key="index"
                      @click="getSingleMap(item,index)"
                      :class="activeMenuIndex===index ?'activeMu':''"
                    >
                      <!-- <router-link
                    to="/SolutionOverview"
                    class="index-menu-item-title nopointer"
                    target="_blank"
                  >
                      </router-link>-->
                      <span class="index-menu-item-title pointer">{{ item.ModuleName }}</span>
                      <i class="aliyun-icon aliyun-icon-arrow_right index-menu-item-icon"></i>

                      <div class="index-menu-item-top-list">
                        <!-- <router-link
                      to="/SolutionOverview"
                      class="top-list-item pointer"
                      v-for="(obj, i) in item.sub"
                      :key="i"
                      target="_blank"
                        ></router-link>-->
                        <span
                          class="top-list-item pointer"
                          v-for="(obj, i) in item.sub"
                          :key="i"
                        >{{ obj.SubName }}</span>
                      </div>
                    </div>
                  </div>
                </div>
                <!-- <a href class="index-menu-bottom-btn" target="_blank">View All</a> -->
              </div>
              <!-- 中间轮播级选项 -->
              <div class="index-menu-content index-slot-right">
                <!-- 轮播图 -->
                <div class="index-banner">
                  <slider ref="slider" :options="options">
                    <!-- slideritem wrapped package with the components you need -->
                    <slideritem v-for="(item,index) in noticeInfo" :key="index">
                      <img
                        v-if="item.PictrueUrl"
                        :src="item.PictrueUrl"
                        width="100%"
                        @click="toArticle(item)"
                        @error="bannerNoImg"
                      />
                      <a-empty v-else style class="empty" :description="'No pictures'" />
                    </slideritem>
                  </slider>
                </div>
                <!-- 以上轮播图 -->
                <div class="flex index-slot-right-bottom">
                  <div class="index-box-wrap">
                    <div class="index-box-item">
                      <div class="index-box-link">
                        <div class="index-box-title">Present Activity</div>
                        <!-- <slider ref="slider" :options="options" class="PresentSlider">
                          <slideritem v-for="(item,index) in PresentImgList" :key="index">
                            <img :src="getImgUrl(item,'jpg')" width="100%" />
                          </slideritem>
                        </slider>-->
                        <div class="ActivityBox">
                          <div
                            v-for="(item, index) in activityInfo"
                            :key="index"
                            class="flex ActivitySingle"
                            @click="toArticle(item)"
                          >
                            <img
                              v-if="item.PictrueUrl"
                              :src="item.PictrueUrl"
                              alt
                              style="width:50px;"
                              @error="noImg"
                            />
                            <a-empty v-else style class="empty" :description="'No pictures'" />
                            <p>{{ item.ActivityName }}</p>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="index-box-item">
                      <div class="index-box-link" target="_blank">
                        <div class="index-box-title">My Browser History</div>

                        <div class="browserHistoryBox">
                          <div
                            class="historyDetail pointer"
                            v-for="(item, index) in browsingHistory"
                            :key="index"
                            @click="toSchemePage(item)"
                          >
                            <span :alt="item.SubAppsSolutions">{{ item.SubAppsSolutions }}</span>
                            <a-rate :default-value="item.Satisfaction" disabled class="star" />
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="user-info">
                    <div class="personal-center">
                      <div>
                        <div class="upper-half-avatar">
                          <img alt src="../../assets/img/index/userImg.png" />
                        </div>
                      </div>
                      <!-- [{"NTID":"admin","UserPwd":"admin","UserName":"admin","Sector":null,"Workcell":null,"Division":null,"Role":null,"IsSME":true,"DeptId":"0D1DFC574487492EA876B1E43A209A4E","RoleId":"93496365AAB94DBA964D596EB81E5AC2","Phone":"13809248838","Email":"13809248838@qq.com","IsEnabled":false,"IsAdmin":false,"IsDeptAdmin":false,"CreateTime":"2020-07-07T09:19:44.24","CreateBy":"1"}] -->
                      <div
                        class="upper-half-introduction"
                      >Hi! {{ userInfo.UserName? userInfo.UserName:"N/A" }}</div>
                      <div class="userDetails">
                        <div class="ok">
                          <p class="t1">NTID</p>
                          <p class="t2">{{ userInfo.NTID?userInfo.NTID :"N/A" }}</p>
                        </div>
                        <div class="ok">
                          <p class="t1">Department</p>
                          <p class="t2">{{ userInfo.DeptName?userInfo.DeptName:"N/A" }}</p>
                        </div>
                        <div class="ok">
                          <p class="t1">Jabil Currency</p>
                          <p class="t2">{{ userInfo.JPB? userInfo.JPB:"N/A" }}</p>
                        </div>
                        <div class="ok">
                          <p class="t1">Activity Ranking</p>
                          <p
                            class="t2"
                          >{{ userInfo.ActivityRanking?userInfo.ActivityRanking:"N/A" }}</p>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <!-- 浮动框 -->
            <div
              class="sub-menu"
              style="position: absolute;"
              @mouseenter="openPop"
              @mouseleave="closePop"
              v-show="isShowrMenu"
            >
              <div class="hot-activity">
                <span class="sub-menu-title hot-activity-title">Quick Entry</span>
                <div class="hot-activity-list">
                  <div
                    class="hot-activity-item"
                    v-for="(item, index) in thisMenuInfo.sub"
                    :key="index"
                  >
                    <div class="hot-activity-item-link-box" @click="routerTo('/filterList', item)">
                      <!-- <div class="hot-activity-item-link-box" @click="routerTo('/filterList',item)"> -->
                      <!-- 1新页面 0单页 -->
                      <span class="hot-activity-item-title red">{{ item.SubName }}</span>
                      <!-- <a class="hot-activity-item-link">Details</a> -->
                      <!-- <div
                        class="addProjectBtn pointer"
                        @click.stop="toAddProjectPage(thisMenuInfo,index)"
                      >Add</div>-->
                      <!-- :src="$host+ onlineImgList[index]" -->
                      <img class="img" v-if="item.AdPictrue" :src="item.AdPictrue" @error="noImg" />
                      <img class="img" v-else src="@/assets/img/noImg.png" @error="noImg" />
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <!-- 以上浮动框 -->
          </div>
        </div>

        <!-- 热门案例  -->
        <div class="case box2 bothPadding">
          <div class="case-title">Popular Cases</div>
          <div class="wrapper">
            <div class="tab-menu">
              <!--  :class="activeIndex === index ? 'focus' : ''" -->
              <button
                class
                v-for="(item, index) in leftMenuList"
                :key="index"
                :class="activeIndex === index ? 'focus' : ''"
                @click="caseSelect(item,index)"
              >{{ item.ModuleName }}</button>
            </div>
            <div class="tab-view">
              <div class="tab-view_item">
                <a-empty class="w100" v-if="hotCaseInfo.length<=0" />

                <div
                  class="case-wrap"
                  v-for="(item, index) in hotCaseInfo"
                  :key="index"
                  @click="toSchemePage(item)"
                >
                  <!-- 背景图片 -->
                  <div class="case-block">
                    <img
                      v-if="item.SchemeImage[0]"
                      :src="item.SchemeImage[0]"
                      @mouseover="item.isShowLot=true"
                      @mouseleave="item.isShowLot=false"
                      class="img"
                      @error="noImg"
                    />
                    <a-empty class="img" v-else />

                    <div class="content">
                      <!-- v-if="item.isShowLot " -->
                      <div class="case-block-top">
                        <div class="case-bt-right">
                          <p>
                            <span>name:</span>
                            <span :alt="item.SubAppsSolutions">{{ item.SubAppsSolutions }}</span>
                          </p>
                          <p>
                            <span>Price:</span>
                            <span>{{ item.CostofInvestment }}</span>
                          </p>
                          <p>
                            <span>JabilCome:</span>
                            <span class="t2">{{ item.JPB }}</span>
                          </p>
                          <p>
                            <span>Department:</span>
                            <span>{{ item.DeptName }}</span>
                          </p>
                          <p>
                            <span>Project Leader:</span>
                            <span>{{ item.ProjectLeader }}</span>
                          </p>
                          <p></p>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- 以上热门案例 -->

        <!-- 猜你喜欢  -->
        <div class="container-wrap bothPadding" style="width:1200px;margin-bottom:50px;">
          <div class="case-title">You may also like</div>
          <div class="flex content">
            <div class="container-left" style>
              <!-- <div class="left-title">intelligent hardware</div> -->
              <div class="left-description">
                <!-- Selected by jap data platform, it covers hardware commodities in
              intelligent living, intelligent city, intelligent park, intelligent
                industry, intelligent agriculture, retail and many other scenarios-->
              </div>
              <a class="solve-wrap-left-link">Jabil IoT</a>
            </div>
            <div class="container-right">
              <div class="home-lot-wrap">
                <div id="J_goodsList" class="goods-list-v2 gl-type-2 J-goods-list flex">
                  <div
                    class="gl-item gl-warp clearfix flex jc"
                    v-for="(item, index) in guessLikeInfo"
                    :key="index"
                    @click="toSchemePage(item)"
                  >
                    <div class="gl-i-wrap">
                      <div class="p-img">
                        <a target="_blank">
                          <a-empty class="img" v-if="item.SchemeImage.length<=0" />

                          <img
                            width="220"
                            height="282"
                            v-else
                            :src="item.SchemeImage[0] "
                            @error="noImg"
                          />

                          <!-- <img width="220" height="282" :src="Array.from(item.SchemeImage)[0] " /> -->
                        </a>
                      </div>
                      <!-- scroll img -->
                      <div class="p-scroll scrolled"></div>
                      <div class="p-price">
                        <strong class="J_10337645533">
                          <!-- <em>￥</em> -->
                          <i>{{ item.CostofInvestment }}</i>
                        </strong>
                      </div>
                      <div class="p-name p-name-type-3">
                        <a target="_blank">
                          <em>{{ item.SubAppsSolutions }}</em>
                        </a>
                      </div>
                      <div class="p-commit">
                        <div class="flex starBox ac">
                          <strong>
                            <!-- <a>11万+</a>条评价 -->
                            evaluation
                          </strong>
                          <a-rate :default-value="item.Satisfaction" disabled class="star ml36" />
                        </div>
                      </div>
                      <div class="p-commit">
                        <div>
                          <strong>
                            The current heat
                            <a>{{ item.BrowseTimes }}</a>
                          </strong>
                        </div>
                      </div>
                      <div class="p-commit">
                        <div>
                          <strong>
                            Upload time
                            <a>{{ item.CreateTime }}</a>
                          </strong>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- 以上猜你喜欢 -->

        <div class="footer" style="margin-bottom:50px;display:none;">
          <!-- 宏观统计  -->
          <div class="MacroStatistics">
            <div class="case-title">Macro statistics</div>
            <div style="width:100%; background:white;">
              <!-- <img src="../../assets/img/dataShow.png" width="1200px" alt /> -->
              <v-echarts style="echartsBox"></v-echarts>
            </div>
          </div>
          <!-- 以上宏观统计 -->

          <!-- 行业链接 -->
          <div class="industryLink">
            <section class="rno-2-section rno-2-logo-case-section" id="section-customer">
              <div class="rno-2-section-inner">
                <div class="rno-2-section-hd">
                  <h3 class="rno-2-section-title">Industry benchmark customer</h3>
                  <h3 class="rno-2-section-title mobile">Industry benchmark customer</h3>
                </div>
                <div class="rno-2-section-bd">
                  <div class="rno-tabs rno-tabs-skin-1">
                    <div class="rno-tabs-bar">
                      <ul class="rno-tabs-list">
                        <li
                          class="rno-tabs-item J-customerTab"
                          :class="index === industryActive ? 'rno-tabs-active' : ''"
                          @click="industryActive = index"
                          v-for="(item, index) in conpanyList"
                          :key="index"
                        >
                          <a class="rno-tabs-item-con">{{ item }}</a>
                          <b class="tabs-animation"></b>
                        </li>
                      </ul>
                    </div>
                    <div class="rno-tabs-content J-customerContent" v-if="industryActive === 0">
                      <div class="rno-1-logo-cases">
                        <div class="rno-lattice rno-lattice-cols-6">
                          <div
                            class="rno-lattice-cell disabled"
                            v-for="(item, index) in 8"
                            :key="index"
                          >
                            <div class="rno-1-logo-case">
                              <a target="_blank">
                                <img
                                  v-if="getImgUrl(companyLogoList[index])"
                                  class="J-homeCustomerImg"
                                  :src="getImgUrl(companyLogoList[index])"
                                  @error="noImg"
                                />
                              </a>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="rno-tabs-content J-customerContent" v-if="industryActive === 1">
                      <div class="rno-1-logo-cases">
                        <div class="rno-lattice rno-lattice-cols-6">
                          <div
                            class="rno-lattice-cell disabled"
                            v-for="(item, index) in 8"
                            :key="index"
                          >
                            <div class="rno-1-logo-case">
                              <a>
                                <img
                                  v-if="getImgUrl(companyLogoList[index])"
                                  class="J-homeCustomerImg"
                                  :src="getImgUrl(companyLogoList[index])"
                                  @error="noImg"
                                />
                              </a>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                  <!-- 移动端客户案例 s -->
                  <!-- 移动端客户案例 e -->
                  <!-- <div class="rno-more-link">
                <a class="rno-link rno-link-arrow">查看所有客户案例</a>
                  </div>-->
                </div>
              </div>
            </section>
          </div>
        </div>
      </div>
    </div>

    <!-- 版权说明 -->
    <!-- <div class="copyright"></div> -->
  </div>
</template>

<script>
import Header from '../../components/layout/header'
import { slider, slideritem } from 'vue-concise-slider'
import vEcharts from '../../components/echarts/indexEcharts'
import p from '@/public/public'
import BScroll from 'better-scroll'
export default {
  name: 'Index',
  data() {
    return {
      NTID: '',
      caseList: [],
      activeMenuIndex: 0,
      activeIndex: 0,
      isShowrMenu: false,
      guessLikeInfo: [],
      isOnPop: false,
      singleMapList: [],
      isOnLeftMenu: false,
      isShowLot: false,
      industryActive: 0, //行业链接当前index
      leftMenuList: [], //左边菜单列表
      thisModuleId: '', //当前选中的一级菜单id
      thisMenuInfo: [], //当前选中的菜单信息展示
      browsingHistory: [],
      userInfo: {},
      RoleId: '',
      menuAuthInfo: [],
      menuBtnAutnInfo: [],
      noticeInfo: [],
      activityInfo: [],
      MenuId: 'IndexSetting',
      bannerImgList: [
        'banner01.jpg',
        'banner02.jpg',
        'banner03.jpg',
        'banner04.jpg',
      ],
      onlineImgList: [
        '/7c4059253a5a4c4c8b031a394896fc38.png',
        '/81e7eb251f4e4918b617428aafc4d215.png',
        '/47d4c91ce1444743a7e7a270f949cf43.png',
        '/7b91d3471a2b435482486e7bf3170a43.png',
        '/e2c4e54ff28c4990bfcf0fab4da39654.png',
        '/7e9cd6065f2c459a84ef7500a58b1d95.png',
      ],
      companyLogoList: [
        'amazon.jpg',
        'gaotong.jpg',
        'google.jpg',
        'hp.jpg',
        'IBM.jpg',
        'microsoft.jpg',
        'nvidia.jpg',
        'sanxing.jpg',
        'apple.jpg',
      ],
      PresentImgList: ['001.png', '002.png'],
      hotCaseList: [
        { num: 1, isShowLot: false },
        { num: 1, isShowLot: false },
        { num: 1, isShowLot: false },
        { num: 1, isShowLot: false },
      ],
      hotCaseInfo: [],
      // 猜你喜欢背景图
      schemeImgRandomList: [
        { src: '001.png' },
        { src: '002.png' },
        { src: '003.png' },
        { src: '004.png' },
        { src: '005.png' },
        { src: '006.png' },
      ],
      list: [
        { num: 1, isShowLot: false },
        { num: 1, isShowLot: false },
        { num: 1, isShowLot: false },
        { num: 1, isShowLot: false },
        { num: 1, isShowLot: false },
        { num: 1, isShowLot: false },
      ],
      // 轮播参数
      options: {
        pagination: true,
        thresholdDistance: 100, // Sliding distance threshold
        thresholdTime: 300, // Sliding time threshold decision
        grabCursor: true, // Scratch style
        speed: 1000, // Sliding speed
        timingFunction: 'ease', // Sliding mode
        loop: true, // Infinite loop
        autoplay: 3500, // Auto play[ms]
      },
      bbsList: [
        'Science and technology god reply | black market several thousand yuan can check individual running water, net friend: really need not check me, have no several thousand yuan',
        'Li bin said goodbye to the "good man" and wei lai said goodbye to the "republic"',
        'On the eve of the autopilot landing, BAT and huawei entered the "final battlefield".',
      ],
      conpanyList: ['Industry connection', 'supplier'],
      // 视频options
      playerOptions: {
        //播放速度
        playbackRates: [0.5, 1.0, 1.5, 2.0],
        //如果true,浏览器准备好时开始回放。
        autoplay: false,
        // 默认情况下将会消除任何音频。
        muted: false,
        // 导致视频一结束就重新开始。
        loop: false,
        // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频（如果浏览器支持）
        preload: 'auto',
        language: 'zh-CN',
        // 将播放器置于流畅模式，并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字（例如"16:9"或"4:3"）
        aspectRatio: '16:9',
        // 当true时，Video.js player将拥有流体大小。换句话说，它将按比例缩放以适应其容器。
        fluid: true,

        sources: [],
        //你的封面地址
        poster: '',
        //允许覆盖Video.js无法播放媒体源时显示的默认信息。
        notSupportedMessage:
          'This video cannot play at the moment, please try again later',
        controlBar: {
          timeDivider: true,
          durationDisplay: true,
          remainingTimeDisplay: false,
          //全屏按钮
          fullscreenToggle: true,
        },
      },
      theSection: '',
      default: 'this.remove()',
    }
  },
  components: {
    Header,
    slider,
    slideritem,
    vEcharts,
  },
  created() {
    this.init()
    let userInfo = JSON.parse(sessionStorage.getItem('userInfo'))
    if (userInfo && userInfo.length > 0) {
      this.NTID = userInfo[0].NTID
      this.RoleId = userInfo[0].RoleId
      this.getUserInfo()
    } else {
      this.userInfo = {}
      this.userInfo.UserName = 'N/A'
      this.userInfo.NTID = 'N/A'
      this.userInfo.DeptName = 'N/A'
      this.userInfo.JPB = 'N/A'
      this.userInfo.ActivityRanking = 'N/A'
    }
  },
  mounted() {
    this.getMenuAuth()
    // this.getMenuBtnAuth()
    this.getActorsInfo()
    this.getHotCase()
  },
  methods: {
    getUserInfo() {
      // 查询
      const a = {
        method: 'SysUser_Que',
        userId: window.userId || 1,
        sign: '1',
        datas: {
          NTID: '%' + this.NTID + '%',
        },
      }
      this.$post(a).then((result) => {
        if (result.data.length > 0) {
          this.tableData = result.data.length > 0 ? result.data : []
          this.totalCount = result.count
          this.tableData.map((item) => {
            item.IsSME = item.IsSME.toString()
            item.IsEnabled = item.IsEnabled.toString()
            item.CreateTime = item.CreateTime.replace('T', ' ').split('.')[0]
            return item
          })
          console.log('this.tableData :>> ', this.tableData)
          this.userInfo = this.tableData[0]
        }
      })
    },
    bannerNoImg(event) {
      // console.log('event :>> ', event)
      event.target.style.objectFit = 'contain'
      this.$pk.errorImg(event)
    },
    noImg(event) {
      // console.log('event :>> ', event)

      this.$pk.errorImg(event)
    },
    toArticle(item) {
      let Details = item.Details

      let routeData = this.$router.resolve({
        path: '/article',
        query: { Details: Details },
      })
      window.open(routeData.href, '_blank')
      console.log('object :>> ', routeData)
    },
    getActorsInfo() {
      // 查询活动
      const a = {
        method: 'SysActivity_Que',
        userId: window.userId || 1,
        sign: '1',
        currentPage: 0,
        limit: 0,
        datas: {
          ActivityType: 2, //1公告 2 活动
        },
      }
      this.$post(a).then((result) => {
        if (result.code == 0) {
          this.activityInfo = result.data
        }
      })

      //  查询公告
      const b = {
        method: 'SysActivity_Que',
        userId: window.userId || 1,
        sign: '1',
        currentPage: 0,
        limit: 0,
        datas: {
          ActivityType: 1, //2 活动 1公告
        },
      }
      this.$post(b).then((result) => {
        if (result.code == 0) {
          this.noticeInfo = result.data
        }
      })
    },
    getMenuAuth() {
      const a = {
        method: 'SysMenuAuthority_Que',
        userId: window.userId || 1,
        sign: '1',
        currentPage: 0,
        limit: 0,
        datas: {
          RoleId: this.RoleId,
        },
      }

      this.$post(a).then((result) => {
        console.log('SysMenuAuthority_Que :>> ', result)
        this.menuAuthInfo = result.data
      })
    },
    // getMenuBtnAuth() {
    //   const a = {
    //     method: 'SysButtonAuthority_Que',
    //     userId: window.userId || 1,
    //     sign: '1',
    //     currentPage: 0,
    //     limit: 0,
    //     datas: {
    //       RoleId: this.RoleId,
    //       MenuId: 'IndexSetting'
    //     }
    //   }

    //   this.$post(a).then(result => {
    //     console.log('SysButtonAuthority_Que :>> ', result)
    //     this.menuBtnAutnInfo = result.data
    //   })
    // },
    initScroll() {
      // new BScroll(this.$refs.menuScroll) //实例化    用this.$refs.menuScroll 来找到要滚动的元素
    },
    init() {
      this.getLayOutMenu()
      this.getYouLike()
      this.geHistory()
      this.getActivityInfo()
    },
    getSingleMap(item, index) {
      this.activeMenuIndex = index
      this.getPopData(item)
      this.isShowrMenu = true
      this.singleMapList = item
      console.log('item :>> ', item)
      sessionStorage.setItem('ModuleName', item.ModuleName)
    },
    callBack(e) {},
    caseSelect(item, e) {
      console.log('item :>> ', item)
      this.activeIndex = e
      this.theSection = item.ModuleName
      this.getHotCase()
    },
    openPop() {
      this.isOnPop = true
      this.isShowrMenu = true
    },
    closePop() {
      this.isOnPop = false
      setTimeout(() => {
        if (!this.isOnPop && !this.isOnLeftMenu) {
          this.isShowrMenu = false
        }
      }, 500)
    },
    getImgUrl(url) {
      const b = require('../../assets/img/index/' + url)
      return b
    },
    // 左边悬浮菜单
    getPopData(e) {
      this.thisMenuInfo = e
    },
    onLeftMenu() {
      this.isOnLeftMenu = true
      // if (this.singleMapList.sub.length) {
      //   this.isShowrMenu = true
      // }
    },
    leaveLeftMenu() {
      this.isOnLeftMenu = false

      setTimeout(() => {
        if (!this.isOnLeftMenu && !this.isOnPop) {
          // this.thisMenuInfo = []
          this.isShowrMenu = false
        } else {
          this.isShowrMenu = true
        }
      }, 500)
    },
    //菜单查询
    getLayOutMenu() {
      const a = {
        method: 'ShpModule_Que',
        userId: window.userId || 1,
        sign: '1',
        currentPage: 0,
        limit: 0,
        language: window.language || 1,
        datas: {},
      }
      const b = {
        method: 'ShpModuleSub_Que',
        userId: window.userId || 1,
        sign: '1',
        currentPage: 0,
        limit: 0,
        language: window.language || 1,
        datas: {
          // ModuleId: '01'
        },
      }

      // 左边纵向菜单列表接口
      this.$post(a)
        .then((result) => {
          // result = eval('(' + result + ')')
          this.leftMenuList = result.data ? result.data : []
          console.log('leftMenuList :>> ', this.leftMenuList)
        })
        .then(() => {
          // 左边纵向菜单列表子菜单接口
          this.$post(b).then((result) => {
            for (const i in result.data) {
              for (const key in this.leftMenuList) {
                if (i == 0) {
                  this.leftMenuList[key].sub = []
                }
                if (
                  this.leftMenuList[key].ModuleId == result.data[i].ModuleId
                ) {
                  const subList = result.data[i]
                  this.leftMenuList[key].sub.push(subList)
                }
              }
            }
          })
        })
    },

    // 跳转至添加方案
    toAddProjectPage(e, index) {
      const a = JSON.stringify([e, index])
      this.$router.push({ name: 'addProject', query: { routeData: a } })
      // console.log(e, 'item')
    },
    routerTo(url, num) {
      const routeUrl = this.$router.resolve(url)
      // console.log('num :>> ', num)
      sessionStorage.setItem('ModuleId', num.ModuleId)
      sessionStorage.setItem('SubId', num.SubId)
      sessionStorage.setItem('department', JSON.stringify(num))
      window.open(routeUrl.href, '_blank')
    },
    getYouLike() {
      const a = {
        method: 'Platform_Que',
        userId: window.userId || 1,
        sign: '1',
        currentPage: 1,
        limit: 6,
        language: 1,
        fieldList: '',
        datas: {
          IsMyLike: '1',
        },
      }
      this.$post(a).then((result) => {
        console.log('like :>> ', result)
        this.guessLikeInfo = result.data
        this.guessLikeInfo.map((item) => {
          item.SchemeImage = eval('(' + item.SchemeImage + ')')
          item.CreateTime = item.CreateTime.replace('T', '')
          item.CreateTime = item.CreateTime.substr(0, 10)
          return item
        })
      })
    },
    getActivityInfo() {
      const a = {
        method: 'Platform_Que',
        userId: window.userId || 1,
        sign: '1',
        currentPage: 1,
        limit: 4,
        language: 1,
        fieldList: '',
        orderByList: 'Satisfaction desc, BrowseTimes desc',
        datas: {
          IsPresentActivity: '1',
        },
      }
      this.$post(a).then((result) => {
        console.log('activity :>> ', result)
      })
    },
    geHistory() {
      const a = {
        method: 'Platform_Que',
        userId: window.userId || 1,
        sign: '1',
        currentPage: 0,
        limit: 0,
        language: 1,
        fieldList: '',
        datas: {
          IsMyBrowserHistory: '1',
        },
      }
      this.$post(a).then((result) => {
        console.log('history :>> ', result)
        this.browsingHistory = result.data.length > 0 ? result.data : []
      })
    },
    getHotCase() {
      const a = {
        method: 'Platform_Que',
        userId: window.userId || 1,
        sign: '1',
        currentPage: 1,
        limit: 4,
        language: 1,
        fieldList: '',
        orderByList: 'BrowseTimes desc',
        datas: {
          SolutionMapList: [this.theSection], //Common可以改成Operation、Material、Engineering
        },
      }
      this.$post(a).then((result) => {
        console.log('hotCaseInfo :>> ', result)
        this.hotCaseInfo = result.data
        this.hotCaseInfo.map((item) => {
          item.SchemeImage = eval('(' + item.SchemeImage + ')')
          return item
        })
      })
    },
    toSchemePage(item) {
      let data = JSON.stringify(item)
      this.$router.push({ name: 'Scheme', query: { item: data } })
    },
  },
}
</script>
<style lang="less" scoped>
@import url('index.less');

.footer {
  // background: white;
  padding-top: 30px;
  margin-top: 30px;
  padding-left: 350px;
  width: 1200px;
}
</style>
